package com.tang.exception_.throws_;

public class ThrowException {
    public static void main(String[] args){
        try{
            ReturnExceptionDemo.methodA();
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
        ReturnExceptionDemo.methodB();
    }
    /*
    * methodA login try
    * methodA finally logout
    * manufacture error
    * methodB login try
    * methodB logout finally
    * */
}

class ReturnExceptionDemo{
    static void methodA(){
        try {
            System.out.println("methodA login try");
            throw new RuntimeException("manufacture error");
        }finally {
            System.out.println("methodA finally logout");
        }

    }
    static void methodB(){
        try {
            System.out.println("methodB login try");
            return;
        }finally {
            System.out.println("methodB logout finally");
        }
    }
}
